package com.estranger.www.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import com.estranger.www.bean.BaseEvent;
import com.estranger.www.bean.function.OriginalEvent;

/**
 * @Created by michangtao
 * @Date 2021/11/4 10:07
 * @Description TODO
 */
@Component
public class EventService {

    @Autowired
    private ApplicationEventPublisher eventPublisher;


    public void publishEvent(BaseEvent event){
        eventPublisher.publishEvent(event);
    }

    public void newPublishEvent(OriginalEvent event){
        eventPublisher.publishEvent(event);
    }

}
